3.48 \(\int \frac {a+a x+c x^2}{1-x^3} \, dx\)

Optimal. Leaf size=32 \[ \frac {1}{3} (a-c) \log \left (x^2+x+1\right )-\frac {1}{3} (2 a+c) \log (1-x) \]

[Out]

-1/3*(2*a+c)*ln(1-x)+1/3*(a-c)*ln(x^2+x+1)

________________________________________________________________________________________

Rubi [A]  time = 0.03, antiderivative size = 32, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 20, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.150, Rules used = {1875, 31, 628} \[ \frac {1}{3} (a-c) \log \left (x^2+x+1\right )-\frac {1}{3} (2 a+c) \log (1-x) \]

Antiderivative was successfully verified.

[In]

Int[(a + a*x + c*x^2)/(1 - x^3),x]

[Out]

-((2*a + c)*Log[1 - x])/3 + ((a - c)*Log[1 + x + x^2])/3

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 628

Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[(d*Log[RemoveContent[a + b*x +
c*x^2, x]])/b, x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[2*c*d - b*e, 0]

Rule 1875

Int[(P2_)/((a_) + (b_.)*(x_)^3), x_Symbol] :> With[{A = Coeff[P2, x, 0], B = Coeff[P2, x, 1], C = Coeff[P2, x,
 2], q = (-(a/b))^(1/3)}, Dist[(q*(A + B*q + C*q^2))/(3*a), Int[1/(q - x), x], x] + Dist[q/(3*a), Int[(q*(2*A
- B*q - C*q^2) + (A + B*q - 2*C*q^2)*x)/(q^2 + q*x + x^2), x], x] /; NeQ[a*B^3 - b*A^3, 0] && NeQ[A + B*q + C*
q^2, 0]] /; FreeQ[{a, b}, x] && PolyQ[P2, x, 2] && LtQ[a/b, 0]

Rubi steps

\begin {align*} \int \frac {a+a x+c x^2}{1-x^3} \, dx &=\frac {1}{3} \int \frac {a-c+(2 a-2 c) x}{1+x+x^2} \, dx+\frac {1}{3} (2 a+c) \int \frac {1}{1-x} \, dx\\ &=-\frac {1}{3} (2 a+c) \log (1-x)+\frac {1}{3} (a-c) \log \left (1+x+x^2\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.01, size = 31, normalized size = 0.97 \[ \frac {1}{3} \left ((a-c) \log \left (x^2+x+1\right )-(2 a+c) \log (1-x)\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[(a + a*x + c*x^2)/(1 - x^3),x]

[Out]

(-((2*a + c)*Log[1 - x]) + (a - c)*Log[1 + x + x^2])/3

________________________________________________________________________________________

fricas [A]  time = 0.59, size = 26, normalized size = 0.81 \[ \frac {1}{3} \, {\left (a - c\right )} \log \left (x^{2} + x + 1\right ) - \frac {1}{3} \, {\left (2 \, a + c\right )} \log \left (x - 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c*x^2+a*x+a)/(-x^3+1),x, algorithm="fricas")

[Out]

1/3*(a - c)*log(x^2 + x + 1) - 1/3*(2*a + c)*log(x - 1)

________________________________________________________________________________________

giac [A]  time = 0.15, size = 27, normalized size = 0.84 \[ \frac {1}{3} \, {\left (a - c\right )} \log \left (x^{2} + x + 1\right ) - \frac {1}{3} \, {\left (2 \, a + c\right )} \log \left ({\left | x - 1 \right |}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c*x^2+a*x+a)/(-x^3+1),x, algorithm="giac")

[Out]

1/3*(a - c)*log(x^2 + x + 1) - 1/3*(2*a + c)*log(abs(x - 1))

________________________________________________________________________________________

maple [A]  time = 0.05, size = 36, normalized size = 1.12 \[ -\frac {2 a \ln \left (x -1\right )}{3}+\frac {a \ln \left (x^{2}+x +1\right )}{3}-\frac {c \ln \left (x -1\right )}{3}-\frac {c \ln \left (x^{2}+x +1\right )}{3} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c*x^2+a*x+a)/(-x^3+1),x)

[Out]

-1/3*ln(x-1)*c-2/3*ln(x-1)*a+1/3*ln(x^2+x+1)*a-1/3*ln(x^2+x+1)*c

________________________________________________________________________________________

maxima [A]  time = 2.97, size = 26, normalized size = 0.81 \[ \frac {1}{3} \, {\left (a - c\right )} \log \left (x^{2} + x + 1\right ) - \frac {1}{3} \, {\left (2 \, a + c\right )} \log \left (x - 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c*x^2+a*x+a)/(-x^3+1),x, algorithm="maxima")

[Out]

1/3*(a - c)*log(x^2 + x + 1) - 1/3*(2*a + c)*log(x - 1)

________________________________________________________________________________________

mupad [B]  time = 4.78, size = 35, normalized size = 1.09 \[ \frac {a\,\ln \left (x^2+x+1\right )}{3}-\frac {c\,\ln \left (x-1\right )}{3}-\frac {2\,a\,\ln \left (x-1\right )}{3}-\frac {c\,\ln \left (x^2+x+1\right )}{3} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(-(a + a*x + c*x^2)/(x^3 - 1),x)

[Out]

(a*log(x + x^2 + 1))/3 - (c*log(x - 1))/3 - (2*a*log(x - 1))/3 - (c*log(x + x^2 + 1))/3

________________________________________________________________________________________

sympy [A]  time = 0.87, size = 24, normalized size = 0.75 \[ \frac {\left (a - c\right ) \log {\left (x^{2} + x + 1 \right )}}{3} - \frac {\left (2 a + c\right ) \log {\left (x - 1 \right )}}{3} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c*x**2+a*x+a)/(-x**3+1),x)

[Out]

(a - c)*log(x**2 + x + 1)/3 - (2*a + c)*log(x - 1)/3

________________________________________________________________________________________